package com.cfg;

import com.aop.LogMethodExecutionAspect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * 启动注解
 * author: lbw
 */
@Configuration
@EnableAspectJAutoProxy // 启用 AOP 支持
@ComponentScan(basePackages = {"com.aop", "com.cfg", "com.websocket"})
public class AopAutoConfiguration {
    @Bean
    public LogMethodExecutionAspect initLogMethodExecutionAspect() {
        System.out.println("(♥◠‿◠)ﾉﾞ 日志追踪注册成功   ლ(´ڡ`ლ)ﾞ  ");
        return new LogMethodExecutionAspect(); // 返回 AOP 实例，自动注册
    }
}
